package creation_patterns.simple_factory_pattern;

import creation_patterns.simple_factory_pattern.abstract_product.Ball;
import creation_patterns.simple_factory_pattern.concrete_product.Basketball;
import creation_patterns.simple_factory_pattern.concrete_product.Football;
import creation_patterns.simple_factory_pattern.concrete_product.TableTennis;
import creation_patterns.simple_factory_pattern.factory.CreateBallFactory;

public class Test {

    public static void main(String[] args) throws InstantiationException, IllegalAccessException {
        Ball basketball = CreateBallFactory.createBallBean(Basketball.class);
        Ball football = CreateBallFactory.createBallBean(Football.class);
        Ball tableTennis = CreateBallFactory.createBallBean(TableTennis.class);
        System.out.println(basketball.createBall());
        System.out.println(football.createBall());
        System.out.println(tableTennis.createBall());
    }
}
